package convert

import (
	"wms/service/model"
	"wms/util"
)

func StockItemSliceToMap(s []*model.StockItem) ([]string, map[string]*model.StockItem) {
	mk := make(map[string]struct{})
	m := make(map[string]*model.StockItem)
	for _, t := range s {
		mk[t.Mac] = struct{}{}
		m[t.Mac] = t
	}
	marr := util.KeyMapToSlice(mk)
	return marr, m
}
